IBM WebSphere MQ Configuration

Purpose: CWSerenade uses IBM WebSphere MQ to communicate with other applications.

HornetQ or WebSphere MQ? You can use HornetQ or IBM WebSphere MQ to perform communication between CWSerenade and other applications when it is necessary to retrieve or place XML data on a server; see JMS (Java Message Service) Providers for CWSerenade for a comparison.

Message log: You can use the CWSerenade MQ Message Log to track XMLs and transactional messages generated or received by CWSerenade.

Configuring WebSphere MQ for CWSerenade

To configure WebSphere MQ for CWSerenade, all users must be logged out of CWSerenade and the SERENADE service must be shut down.

1. Install a full licensed copy of IBM WebSphere MQ on a separate server, such as the CWIntegrate server.

2. Configure CWSerenade to use WebSphere MQ. See Context.XML File, WebSphere MQ Jar Files and CWSerenade Property Settings for WebSphere MQ.

3. Add the user with authority to run the SERENADE service to the MQM user group.

After performing these steps, CWSerenade should be able to write to and read from an IBM WebSphere MQ queue on the MQ manager you supplied. You can verify this by setting up queues and sending a test message using any integration layer process configured for MQ communication in Working with Integration Layer Processes (IJCT). See Integration Layer Processes and Web Services for a list of integration layer processes that use MQ communication.

Note:

• Create all MQ queues as local queues on the CWIntegrate server. You do not need to create any remote queues, transmission queues, sender channels, or receiver channels.

• When performing MQ setup in CWSerenade, the MQ manager is the MQ manager on the MQ server.

WebSphere MQ Client Illustration

If MQ fails to deliver a message: Because CWSerenade uses the MQ Client, if MQ fails to deliver a message, the message is cleared from the queue and MQ does not continue to try to deliver the message. You will need to re-send the message.

Context.XML File

Use the following steps to configure CWSerenade JMS settings on the CWSerenade application server and identify the server running MQ server.

If you use more than one application server, you need to complete these steps on each server.

1.

On the CWSerenade application server, advance to C:\Serenade\server\conf.

2.

In the conf folder, locate and make a backup copy of the context.xml file.

3.

Open the context.xml file using a text editor.

4.

Locate the following section:

<Context useHttpOnly="true">

<Resource name="REPLACE_WITH_JNDI_NAME"

auth="Container"

type="com.ibm.mq.jms.MQQueueConnectionFactory"

factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"

description="JMS Queue Connection Factory"

HOST="REPLACE_WITH_HOST_NAME"

PORT="REPLACE_WITH_MQ_PORT"

CHAN="SYSTEM.DEF.SVRCONN"

TRAN="1"

QMGR="REPLACE_WITH_MQ_MANAGER"/>

<Realm className="org.apache.catalina.realm.JAASRealm"

appName="SerenadeLogin"

userClassNames="com.mincron.cwi.security.SerenadeUserPrincipal"

roleClassNames="com.mincron.cwi.security.AuthenticatedRolePrincipal" />

</Context>

5.

Update the following values:

<Resource name: Enter the name of the queue manager on the MQ Server.

HOST: Enter the name or IP address of the server containing IBM WebSphere MQ and the MQ manager you entered in the Resource name.

PORT: Enter the port identified as Listener on MQ Server. The default port is 1414.

QMGR: Enter the name of the queue manager on the MQ Server.

6.

If the Resource element is commented out, remove the following line:

<!-- Only used for IBM MQ Series - leave commented out for HornetQ

and also remove the -> on the same line as QMGR.

7.

Save the updated context.xml file.

Important: You must restart the Serenade service before your changes take effect.

WebSphere MQ Jar Files

The following jar files are required for WebSphere MQ:

• com.ibm.mq.jar

• com.ibm.mqjms.jar

Location of jar files: To locate these jar files, perform a windows search on the server containing IBM WebSphere MQ.

Copy these jar files to the C:\Serenade\server\custom-lib\ folder on the CWSerenade application server, where C: is the root directory of the server. If you are using multiple application servers, you must copy these jar files to each server.

CWSerenade Property Settings for WebSphere MQ

JMS Properties File Settings for MQ

JNDI Properties File Settings for MQ

Location of properties file: Typically, the CWSerenade properties files are saved on the CWSerenade application server at the following location, where C: is the root directory of the CWSerenade application server.

C:\Serenade\server\conf\cwdirectcpproperties

To edit a properties file: You can use a text editor to edit the file, being careful to only change the settings that are configurable.

Note: If you make a change to a properties file, you must select Change in Refresh System Properties (PROP) or stop and restart the SERENADE service (or the application server) before the changes take effect.

For more information: See CWSerenade Server Configuration for more background on configuring a multi-server environment.

JMS Properties File Settings for MQ

Enter the following in the cwdirectcp_jms.properties file to enable WebSphere MQ.

Setting

Description

CWMQ_TARGET_

CLIENT

Enter 1.

CWMQ_WAIT_TIME

Enter -1.

CWMQ_JNDI_LOOKUP_NAME

Enter java:/comp/env/.

JNDI Properties File Settings for MQ

Enter the following in the cwdirectcp_jndi.properties file to enable WebSphere MQ.

Setting

Description

CWMQ_JNDI_INITIAL_

CONTEXT_FACTORY

Enter org.apache.openejb.client.LocalInitialContextFactory.

CWMQ_JNDI_PROVIDER_URL

Enter jnp://localhost:1099.

CW_JDBC_PROVIDER

Enter openejb:Resource/CWDirectCPDS.

Troubleshooting WebSphere MQ

When using the MQ Client:

• You do not get persistence between CWSerenade and CWIntegrate. This means, that if MQ fails to deliver a message, the message is cleared from the queue and MQ does not continue to try to deliver the message. You will need to re-send the message.

• You must make sure that the network administrator user that runs the SERENADE service has enough authority to run MQ. See the IBM documentation for more information on defining authority to run MQ.

MQ setup Serenade 5.0 March 2015